<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<div class="popup-frame">
		<div class="popup-header">
			<div class="pull-left">
				<h1>新增应用</h1>
			</div>
			<div class="pull-right">
				<a id="btn_save" class="btn" >确定</a>
				<a id="btn_close" class="btn btn-return">关闭</a>
			</div>
		</div>
		<div class="popup-body">
			<div class="popup-body-scroll">
				<div class="popup-content">
					<form id="form_data" name="form_data" method="post" >
						<input type="hidden" name="opmode" id="opmode" value="add">
						<div class="box">
							<label class="input-label" for="name">名称*：</label>
							<input class="input" type="text" id="name" name="name" check="required" info="请输入名称">
						</div>
						<div class="box">
							<label class="input-label" for="sort">排序：</label>
							<input class="input" type="text" id="sort" name="sort" >
						</div>
					</form>
				</div>
			</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var $ = layui.jquery;
			//保存后关闭
			$('#btn_save').on('click', function() {
				send_form('form_data', '{:url("add_weixin_option")}', '', function(ret) {
					if (ret.status == 1) {
						parent.layer.msg(ret.info);
						parent.layer.close(index);
						parent.location.reload(true);
					} else {
						parent.layer.msg(ret.info);
						return false;
					}
				});
			});

			//关闭iframe
			$('#btn_close').click(function() {
				parent.layer.close(index);
			});
		});

	</script>
</block>